
function assert(exg,msg) {
    if( !exg ){
        throw new Error(msg || "错误！")
    }
}
const getRoot = (dom)=>{
    if( typeof dom === 'string'){
        return document.querySelector(dom) || assert(false,`${dom}未获取`)
    }else if( dom instanceof HTMLElement){
        return  dom
    }
}